<template>
	<view class="cencon">
		<view class="tiao"></view>
		<view class="tou">
			<view class="row" v-for="(row,index) in couponValidList" :key="index">
				<view class="one">
					<view class="title">
						{{row.title}}
					</view>
					<view class="term">
						{{row.updatetime}}
					</view>
				</view>
				<view class="jifen">
					<view style="float: left;"><view v-if="row.status==1">+</view><view v-else>-</view></view><view style="float: left;">{{row.give}}</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				couponValidList: [],
				arr:[],
			}
		},
		onLoad() {
			uni.request({
				url:'http://tuiguang.yiyunoto.com/api/member/mem_givemore',
				header:{authtoken:this.$store.state.token},
				method:'POST',
				success:(res)=>{
					console.log("11请求成功",res)
					this.couponValidList=res.data.data
					for(let i =0;i<res.data.data.length;i++){
						this.arr.push( new Date(parseInt(res.data.data[i].updatetime) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " "))
					}
				},
				fail:(res)=>{
					console.log("请求失败",res)
				}
			})
			
		},
		methods: {
			onPullDownRefresh: function() {
				uni.request({
					url:' http://tuiguang.yiyunoto.com/api/member/mem_givemore',
					header:{authtoken:this.$store.state.token},
					method:'POST',
					success:(res)=>{
						console.log("11请求成功",res)
						this.couponValidList=res.data.data
						 uni.stopPullDownRefresh();
					},
					fail:(res)=>{
						console.log("请求失败",res)
					}
				})
			},
			
			touchEnd(index, $event) {
				//解除禁止触发状态
				this.isStop = false;
			},
		}
	}
</script>

<style>
	.cencon {
		width: 100%;
		background: #FFFFFF;
	}
	.tiao {
		width: 100%;
		height: 1upx;
		background: #E6E6E6;
	}
	.one {
		float: left;
	}
	.row {
		width: 100%;
		height: 143upx;
		background: #FFFFFF;
		margin-top: 2upx;
		border-bottom-width: 1upx;
		border-bottom-style: solid;
		border-bottom-color:#EDEDED;
	}
	.title {
		
		font-size: 32upx;
		font-family: PingFangSC-Regular, PingFangSC;
		color: rgba(41, 41, 41, 1);
		padding-left: 30upx;
		padding-top: 30upx;
	}
	.term {
		font-size: 26upx;
		font-family: PingFangSC-Regular, PingFangSC;
		color: rgba(127, 127, 127, 1);
		padding-left: 30upx;
		padding-top: 1upx;
	}
	.jifen {
		font-size: 41upx;
		font-family: PingFangSC-Regular, PingFangSC;
		color: rgba(51, 51, 51, 1);
		padding-left: 610upx;
		padding-top: 43upx;
	}
</style>
